// import React from "react"
import React, { Fragment } from "react";
import './css/leftNav.css'
class LeftNav extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            currentIndex: ''
        }
    }
    render() {
        const { navList } = this.props
        return (
            <Fragment>
                <ul className="navList">
                    {
                        navList.map((item, idx) => {
                            return (
                                <li className={this.state.currentIndex === idx ? "active" : "active1"} onClick={this.ev_click.bind(this, idx)} dangerouslySetInnerHTML={{ __html: item }} ></li>
                            )
                        })
                    }
                </ul>
            </Fragment>
        )
    }
    ev_click(idx) {
        this.setState({
            currentIndex: idx
        })
        // console.log(this.state.currentIndex)
        // console.log(idx)
    }
}

export default LeftNav;